package jgameconsole;

class Vert2 {
	public int x;
	public int y;
	public boolean val;
	
	public void setX(int x) { this.x = x; }
	public void setY(int y) { this.y = y; }
	public void setXY(int x, int y) { this.x = x; this.y = y; }
	public int getX() { return x; }
	public int getY() { return y; }
	
	public void set(boolean b) {
		this.val = b;
	}
	
	public boolean get() {
		return val;
	}
}

class Foo {
	Vert2 vert2 = new Vert2();
	
	public double sum(double a, double b, boolean r) {
		if (r) return a + b; else return a - b;
	}
	
	public double twice(double a) {
		return 2 * a;
	}
};

class Sandbox {
	public Foo foo = new Foo();
}

public class Test {
	public static void main(String[] args) throws InvalidCommand {
		Sandbox sandbox = new Sandbox();
		JGameConsole gameConsole = new JGameConsole(sandbox);
		sandbox.foo.vert2.x = 50;
		
		System.out.println(gameConsole.processCommand("foo.vert2.setX(5)"));
		System.out.println(gameConsole.processCommand("foo.vert2.getX()"));
		System.out.println(gameConsole.processCommand("foo.twice(3.14)"));
		System.out.println(gameConsole.processCommand("foo.sum(13, 1, true)"));
		System.out.println(gameConsole.processCommand("foo.vert2.set(true)"));
		System.out.println(gameConsole.processCommand("foo.vert2.get()"));
	}
}
